<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="keywords" content="美食,团购,外卖,网上订餐,酒店,旅游,电影票,火车票,飞机票">
    <meta name="description" content="美食攻略,外卖网上订餐,酒店预订,旅游团购,飞机票火车票,电影票,ktv团购吃喝玩乐全都有!店铺信息查询,商家评分/评价一站式生活服务网站">
    <title>{$setting['title']}</title>
    <link rel="stylesheet" href="{RES}/plugin/light7/light7.min.css">
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/api.css"/>
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/common.css"/>
    <link rel="stylesheet" href="{php echo $this->cur_mobile_path}/css/shop.css?v=5">
    <link rel="stylesheet" type="text/css" href="{php echo $this->cur_mobile_path}/css/fakeLoader.css">
    <script src="{php echo $this->cur_mobile_path}/script/jquery-1.8.3.min.js"></script>
    <style>
        i {
            width: 12px;
            height: 12px;
            display: inline-block;
            line-height: 12px;
            font-size: 12px;
            margin-right: 2px;
            text-align: center;
            color: #fff;
            border-radius: 2px;
        }
        .icon-bg1{ background:#70bc46;}
        .icon-bg2{ background:#f07373;}
        .icon-bg3{ background:#f1884f;}
        .icon-bg4{ background:#f5a317;}
        .info {
            font-size: 10px;
            color: #a7a2a9;
        }
        .icon-delivery {
            padding: 0 1px;
        border: 1px solid {$setting['style_base']};
        border-radius: 2px;
        background-color: #fff;
        color: {$setting['style_base']};
        font-size: 10px;
        line-height: 12px;
        }
        .footer-bar.bar-tab .tab-item.active .icon, .bar-tab .tab-item:active .icon {
        color: {$setting['style_base']};
        }
        .footer-bar.bar-tab .tab-item.active, .bar-tab .tab-item:active {
        color: {$setting['style_base']};
        }
        .shopname {
            margin: 0;
            padding: 0;
            max-width: 400px;
            color: #333;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-weight: 700;
            font-size: 16px;
            line-height: 16px;
        }
    </style>
</head>
<body>
<div class="fakeloader"></div>
{php $url_search = $this->createMobileUrl('search', array(), true);}
{php $url_user = $this->createMobileUrl('usercenter', array(), true);}
<div id="wrap" style="height:100%;overflow: scroll;overflow-y:scroll;-webkit-overflow-scrolling:touch;">
    <div id="header" style="background-color: {$setting['style_base']};border-bottom: 1px solid {$setting['style_base']};">
        <div class="search" tapmode="topbar-active" onclick="javascript:window.location.href='{$url_search}'">
            <i class="i-back"></i>
        </div>
        <div class="flex-full">选择自己所在的学校</div>
        <div class="map" tapmode="topbar-active"  onclick="javascript:window.location.href='{$url_user}'">
            <i class="i-user"></i>
        </div>
    </div>

    <div id="main" style="margin-top:44px;padding-bottom: 70px;">
        <div class="box item-list" id="index-data">
            {loop $restlist $item}
            {php $url = $this->createMobileUrl('index', array('sid' => $item['id']), true);}
            <section class="item" onclick="location.href='{$url}'">
                <div class="right-wrap">
                    <section class="line">
                        <h3 class="shopname">
                            {$item['title']}
                        </h3>
                    </section>
                </div>
            </section>
            {/loop}
        </div>
        <div class="popup-overlay"></div>
        <input type="hidden" id="curlat" name="curlat" value="0"/>
        <input type="hidden" id="curlng" name="curlng" value="0"/>
        <input type="hidden" id="isposition" name="isposition" value="{$isposition}" />
        <input type="hidden" id="cururl" name="cururl" value="{php echo $this->createMobileurl('location', array(), true)}" />
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=5PESLgvMcSbSUbPjmDKgvGZ3"></script>
        {if $isposition==0}
        <script type="text/javascript" src="../addons/weisrc_dish/template/js/postion.js?v=4"></script>
        {/if}
    </div>
    <script>
        $(document).ready(function(e) {
            $('.filter-header .filter-nav').click(function(e) {
                var index=$(this).index()
                var datavalue=$(this).attr('data-value')//判断是否显示
                if(datavalue==1){
                    $('.filter-header .filter-nav').attr('data-value',0)
                    $(this).find('.i-up').css({"transform":"rotate(0deg)"})
                    $(this).find('span').removeClass('curt')
                    $('.filter-extend').eq(index).removeClass('open');
                    $('.popup-overlay').removeClass('modal-overlay-visible')
                }else{
                    $('.filter-header .filter-nav').attr('data-value',0)
                    $(this).attr('data-value',1)//判断是否显示
                    $('.filter-header .filter-nav span').removeClass('curt')
                    $(this).find('span').addClass('curt')
                    $('.filter-header .filter-nav').find('.i-up').css({"transform":"rotate(0deg)"})
                    $(this).find('.i-up').css({"transform":"rotate(180deg)"})
                    $('.filter-extend').removeClass('open')
                    $('.filter-extend').eq(index).addClass('open');
                    $('.popup-overlay').addClass('modal-overlay-visible')
                }
            });
        });
    </script>
</div>
{php echo register_jssdk(false);}
<script>
    wx.ready(function () {
        sharedata = {
            title: '{$share_title}',
            desc: '{$share_desc}',
            link: '{$share_url}',
            imgUrl: '{$share_image}',
            success: function(){
                //alert('感谢分享');
            },
            cancel: function(){
                //alert('cancel');
            }
        };
        wx.onMenuShareAppMessage(sharedata);
        wx.onMenuShareTimeline(sharedata);
    });
</script>
<script type="text/javascript" src="{RES}/js/jquery.lazyload.min.js"></script>
<script>
    $(function () {
        $("img.lazy").lazyload({effect: "fadeIn"});
    });
</script>

<script type="text/javascript">
    var page = 2;
    var loading  = false;
    var stop_track = false;

    $(document).ready(function() {
        $('#wrap').scroll(function(){
            if ($(window).scrollTop() + $(window).height() == $(document).height()) {
                if(stop_track == false && loading==false) {
                    loading = true;
                    var loadurl ="{php echo $this->createMobileurl('getmorestore', array('areaid' => $areaid, 'typeid' => $typeid, 'sid' => $sid), true)}";
                    $.ajax({
                        type: 'POST',
                        url: loadurl,
                        data: {
                            'page': page
                        },
                        dataType: 'json',
                        timeout: 3000,
                        context: $('body'),
                        success: function(data){
                            if (data == '0') {
                                stop_track = true;
                            } else {
                                $("#index-data").append(data);
                                if (data == '') {
                                    stop_track = true;
                                }
//                                $('.animation_image').hide();
                                page++;
                                loading = false;
                            }
                        },
                        error: function (xhr) {
                            alert('网络通讯失败，请重试!');
                        }
                    });
                }
            }
        });
    });
</script>
</body>
</html>
